home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / fsrmt.h < prev    next >
C/C++ Source or Header  |  1990-12-08  |  6KB  |  145 lines

  1. /*
  2.  * fsrmt.h --
  3.  *
  4.  *    Definitions of the parameters required for Sprite Domain operations
  5.  *
  6.  * Copyright (C) 1985 Regents of the University of California
  7.  * All rights reserved.
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  *
  17.  * $Header: /sprite/src/kernel/fsrmt/RCS/fsrmt.h,v 9.3 90/12/06 21:56:15 jhh Exp $ SPRITE (Berkeley)
  18.  */
  19.  
  20. #ifndef _FSRMT
  21. #define _FSRMT
  22.  
  23. #include <fsNameOps.h>
  24. #include <proc.h>
  25.  
  26. #include <fsutil.h>
  27. #include <fscache.h>
  28.  
  29.  
  30. /* 
  31.  * The I/O descriptor for remote streams.  This is all that is needed for
  32.  *    remote devices, remote pipes, and named pipes that are not cached
  33.  *    on the local machine.  This structure is also embedded into the
  34.  *    I/O descriptor for remote files.  These stream types share some
  35.  *    common remote procedure stubs, and this structure provides
  36.  *    a common interface.
  37.  *    FSIO_RMT_DEVICE_STREAM, FSIO_RMT_PIPE_STREAM, FS_RMT_NAMED_PIPE_STREAM,
  38.  *    FSIO_RMT_PSEUDO_STREAM, FSIO_RMT_PFS_STREAM
  39.  */
  40.  
  41. typedef struct Fsrmt_IOHandle {
  42.     Fs_HandleHeader    hdr;        /* Standard handle header.  The server
  43.                      * ID field in the hdr is used to
  44.                      * forward the I/O operation. */
  45.     Fsutil_RecoveryInfo    recovery;    /* For I/O server recovery */
  46. } Fsrmt_IOHandle;
  47.  
  48.  
  49. /*
  50.  * The I/O descriptor for a remote file.  Used with FSIO_RMT_FILE_STREAM.
  51.  */
  52.  
  53. typedef struct Fsrmt_FileIOHandle {
  54.     Fsrmt_IOHandle    rmt;        /* Remote I/O handle used for RPCs. */
  55.     Fscache_FileInfo    cacheInfo;    /* Used to access block cache. */
  56.     Fscache_ReadAheadInfo    readAhead;    /* Read ahead info used to synchronize
  57.                      * with other I/O and closes/deletes. */
  58.     int            openTimeStamp;    /* Returned on open from the server
  59.                      * and used to catch races with cache
  60.                      * consistency msgs due to other opens*/
  61.     int            flags;        /* FS_SWAP */
  62.     struct Vm_Segment    *segPtr;    /* Reference to code segment needed
  63.                      * to flush VM cache. */
  64. } Fsrmt_FileIOHandle;            /* 216 BYTES  (264 with traced locks)*/
  65.  
  66. /*
  67.  * RPC debugging.
  68.  */
  69. extern    Boolean    fsrmt_RpcDebug;
  70.  
  71.  
  72. extern void Fsrmt_IOHandleInit _ARGS_((Fs_FileID *ioFileIDPtr, int useFlags,
  73.         char *name, Fs_HandleHeader **newHandlePtrPtr));
  74.  
  75. /*
  76.  * General purpose remote stubs shared by remote files, devices, pipes, etc.
  77.  */
  78. extern ReturnStatus Fsrmt_Read _ARGS_((Fs_Stream *streamPtr, 
  79.         Fs_IOParam *readPtr, Sync_RemoteWaiter *waitPtr, 
  80.         Fs_IOReply *replyPtr));
  81. extern ReturnStatus Fsrmt_Write _ARGS_((Fs_Stream *streamPtr, 
  82.         Fs_IOParam *writePtr, Sync_RemoteWaiter *waitPtr, 
  83.         Fs_IOReply *replyPtr));
  84. extern ReturnStatus Fsrmt_Select _ARGS_((Fs_HandleHeader *hdrPtr, 
  85.         Sync_RemoteWaiter *waitPtr, int *readPtr, int *writePtr, 
  86.         int *exceptPtr));
  87. extern ReturnStatus Fsrmt_IOControl _ARGS_((Fs_Stream *streamPtr,
  88.         Fs_IOCParam *ioctlPtr, Fs_IOReply *replyPtr));
  89. extern ReturnStatus Fsrmt_Close _ARGS_((Fs_Stream *streamPtr, int clientID, 
  90.         Proc_PID procID, int flags, int dataSize, 
  91.         ClientData closeData));
  92. extern ReturnStatus Fsrmt_GetIOAttr _ARGS_((Fs_FileID *fileIDPtr, int clientID,
  93.         Fs_Attributes *attrPtr));
  94. extern ReturnStatus Fsrmt_SetIOAttr _ARGS_((Fs_FileID *fileIDPtr, 
  95.         Fs_Attributes *attrPtr, int flags));
  96. extern ReturnStatus Fsrmt_BlockCopy _ARGS_((Fs_HandleHeader *srcHdrPtr, 
  97.         Fs_HandleHeader *dstHdrPtr, int blockNum));
  98. extern ReturnStatus Fsrmt_DomainInfo _ARGS_((Fs_FileID *fileIDPtr, 
  99.         Fs_DomainInfo *domainInfoPtr));
  100. extern ReturnStatus Fsrmt_IOMigClose _ARGS_((Fs_HandleHeader *hdrPtr, 
  101.         int flags));
  102. extern ReturnStatus Fsrmt_IOMigOpen _ARGS_((Fsio_MigInfo *migInfoPtr, int size,
  103.         ClientData data, Fs_HandleHeader **hdrPtrPtr));
  104. #ifdef SOSP91
  105. extern ReturnStatus Fsrmt_IOClose _ARGS_((Fs_Stream *streamPtr, int clientID,
  106.         Proc_PID procID, int flags, int dataSize, 
  107.         ClientData closeData, int *offsetPtr, int *rwFlagsPtr));
  108. #else
  109. extern ReturnStatus Fsrmt_IOClose _ARGS_((Fs_Stream *streamPtr, int clientID,
  110.         Proc_PID procID, int flags, int dataSize, 
  111.         ClientData closeData));
  112. #endif
  113.  
  114. extern ReturnStatus Fsrmt_DeviceOpen _ARGS_((Fs_FileID *ioFileIDPtr, 
  115.         int useFlags, int inSize, ClientData inBuffer));
  116. extern ReturnStatus Fsrmt_DeviceReopen _ARGS_((Fs_HandleHeader *hdrPtr,
  117.         int clientID, ClientData inData, int *outSizePtr, 
  118.         ClientData *outDataPtr));
  119. extern ReturnStatus FsrmtDeviceMigrate _ARGS_((Fsio_MigInfo *migInfoPtr, 
  120.         int dstClientID, int *flagsPtr, int *offsetPtr, int *sizePtr, 
  121.         Address *dataPtr));
  122.  
  123. extern ReturnStatus Fsrmt_NotifyOfMigration _ARGS_((Fsio_MigInfo *migInfoPtr,
  124.         int *flagsPtr, int *offsetPtr, int outSize, Address outData));
  125.  
  126. extern ReturnStatus FsrmtReopen _ARGS_((Fs_HandleHeader *hdrPtr, int inSize,
  127.         Address inData, int *outSizePtr, Address outData));
  128. extern ReturnStatus FsrmtFileMigrate _ARGS_((Fsio_MigInfo *migInfoPtr, 
  129.         int dstClientID, int *flagsPtr, int *offsetPtr, int *sizePtr, 
  130.         Address *dataPtr));
  131. extern ReturnStatus FsrmtPipeMigrate _ARGS_((Fsio_MigInfo *migInfoPtr, 
  132.         int dstClientID, int *flagsPtr, int *offsetPtr, int *sizePtr, 
  133.         Address *dataPtr));
  134.  
  135. extern void Fsrmt_InitializeOps _ARGS_((void));
  136. extern void Fsrmt_Bin _ARGS_((void));
  137.  
  138. /*
  139.  * Recovery testing operations.
  140.  */
  141. extern    int    Fsrmt_FileRecovTestNumCacheBlocks();
  142. extern    int    Fsrmt_FileRecovTestNumDirtyCacheBlocks();
  143.  
  144. #endif _FSRMT
  145.